﻿<UserControl
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
	xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
	xmlns:local="clr-namespace:JBot"
	mc:Ignorable="d"
	x:Class="JBot.ContactsControl"
	x:Name="UserControl"
	d:DesignWidth="640" d:DesignHeight="480">

	<UserControl.Resources>
		<local:StatusTypeConverter x:Key="StatusTypeConverter"/>
	</UserControl.Resources>

	<Grid x:Name="CtCRoot">
		<Grid.RowDefinitions>
			<RowDefinition Height="45"/>
			<RowDefinition Height="30"/>
			<RowDefinition Height="0.887*"/>
		</Grid.RowDefinitions>
		<Label x:Name="CtC_L" Margin="8,4,0,4" Content="Contacts" VerticalAlignment="Top" HorizontalAlignment="Left" FontSize="17.333"/>
		<ListView x:Name="CtC_LV" Grid.Row="2" ItemsSource="{Binding Contacts, Source={StaticResource xmpp}}" SelectionChanged="CtC_LV_SelectionChanged">
			<ListView.View>
				<GridView>
					<GridViewColumn Header="" Width="30">
						<GridViewColumn.CellTemplate>
							<DataTemplate>
								<Image Height="16" Width="16" Source="{Binding StatusType, Converter={StaticResource StatusTypeConverter}}" />
							</DataTemplate>
						</GridViewColumn.CellTemplate>
					</GridViewColumn>
					<GridViewColumn Header="JID" DisplayMemberBinding="{Binding Jid}" Width="100"/>
					<GridViewColumn Header="Nick" DisplayMemberBinding="{Binding Nickname}" Width="100"/>
					<GridViewColumn Header="Name" DisplayMemberBinding="{Binding Vcard.Fullname}" Width="100"/>
					<GridViewColumn Header="Description" DisplayMemberBinding="{Binding Status}" Width="200"/>
				</GridView>
			</ListView.View>
		</ListView>
		<ToolBar x:Name="CtC_TB" d:LayoutOverrides="HorizontalAlignment" Grid.Row="1">
			<Button x:Name="CtC_TB_Add" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Content="Add" Click="CtC_TB_Add_Click"/>
			<Button x:Name="CtC_TB_Edit" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Content="Edit" Click="CtC_TB_Edit_Click" IsEnabled="False"/>
			<Button x:Name="CtC_TB_Delete" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Content="Delete" Click="CtC_TB_Delete_Click" IsEnabled="False"/>
			<Separator x:Name="CtC_TB_S1"/>
			<Button x:Name="CtC_TB_Block" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Content="Block" Click="CtC_TB_Block_Click" IsEnabled="False"/>
			<Separator x:Name="CtC_TB_S2"/>
			<Button x:Name="CtC_TB_Message" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Content="Message" Click="CtC_TB_Message_Click" IsEnabled="False"/>
		</ToolBar>
	</Grid>
</UserControl>